import React from 'react'
import { AppRegistry } from 'react-native'
import { name as AppName } from '../app.json';
import dva from './utils/dva';
import Router, {  routerReducer } from './router'
import appModel from './models/app';
import Routers from './models/Router';
import { createReactNavigationReduxMiddleware, createNavigationReducer } from 'react-navigation-redux-helpers';
const routerMiddleware = createReactNavigationReduxMiddleware(state => state.router);
const app = dva({
  initialState: {},
  models: [appModel,
    Routers,
    OrderList,
    FunctionHomeList,
    ApplicationHomeList,
    ApplicationSetup,
    BarcodeList,
    CommonFun,
    AboutVersionView
  ],
  extraReducers: { router: routerReducer },
  onError(e) {
    console.log('onError', e)
  },
})

const App = app.start(<Router />);
global.app = app;



AppRegistry.registerComponent(AppName, () => App)
